Coordinated control method and system for electronic devices

ABSTRACT

This application discloses a coordinated control method and system for electronic devices. When triggering coordinated control, a second electronic device sends remote view logic information associated with a running business to a first electronic device. The first device directly locally loads an application-related interface based on an interface layout file included in the remote view logic information. In this way, for the first device end, a component, a parameter, and the like that are related to the running application of the second device do not need to be customized on the first device end for the running application, and only the remote view logic information transmitted to the first device needs to be loaded. Distributed business application logic may be defined for all running applications of the second device on a side of the second device, and then the second device synchronizes the distributed application logic with the first device.

This application is a National Stage of International Application No.PCT/CN2021/105039, filed on Jul. 7, 2021, which claims priority toChinese Patent Application No. 202010651585.9, filed on Jul. 8, 2020,both of which are hereby incorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the field of terminal technologies, and inparticular, to a coordinated control method and system for electronicdevices.

BACKGROUND

With the development of science and technology, intelligent devices havebecome one of peoples' daily necessities. An intelligent device is aproduct obtained after a conventional electrical device is combined witha computer technology, a data processing technology, a control theory, asensor technology, a network communication technology, a powerelectronics technology, and the like. Some intelligent devices include afirst intelligent device and a second intelligent device. The firstintelligent device is a computer device that can control the use of thesecond intelligent device, and includes a smartphone, a notebookcomputer, a desktop computer, and the like. The second intelligentdevice is a system device that processes and controls media informationby using the computer technology and a digital communication networktechnology, such as a smart T, a head unit, a watch, and a sound box.Between the first intelligent device and the second intelligent device,coordinated control may be performed on the second intelligent device bythe first intelligent device. A conventional practice in which the firstintelligent device performs coordinated control on the secondintelligent device is to create a set of application protocols betweenan application of the first intelligent device and an application of thesecond intelligent device, so that coordinated control of theapplication of the first intelligent device and an application of thesecond intelligent device is implemented by using a protocol rule, aparameter, and the like. For example, a mobile phone controls a smart TVto switch programs, and the smart TV transfers display area layoutinformation and a thumbnail of each display area to a host applicationon the mobile phone end. The mobile phone end reconstructs a displaypicture based on the display area layout information and the thumbnailof each display area, and displays the display picture on the mobilephone end. In the foregoing manner, a corresponding scenario needs to besimultaneously customized on the mobile phone end and the smart TV end.When the smart TV end switches a current scenario, the mobile phone endis no longer applicable to a scenario obtained after the smart TVperforms switching. Consequently, the applicable scenario is limited.

SUMMARY

The present invention provides a coordinated control method and systemfor electronic devices, to adapt to a wide range of scenarios.

According to a first aspect, an embodiment of this application providesa coordinated control method for electronic devices. An electronicdevice includes a first electronic device used as a controlling partyand a second electronic device used as a controlled party that areconnected based on near field communication. The coordinated controlmethod includes:

the second electronic device runs an application and triggerscoordinated control, and sends remote view logic information associatedwith the application to the first electronic device, where the remoteview logic information includes an interface layout file;

the first electronic device receives the remote view logic information,locally loads, based on the interface layout file, an interface relatedto the application, and binds a service that is on a side of the secondelectronic device and that is related to the application; and

the first electronic device sends control information to the secondelectronic device based on a service interface externally disclosed bythe service, so that the first electronic device controls the seconddevice to run the application.

According to the coordinated control method for electronic devicesdisclosed in the first aspect of this application, when triggering thecoordinated control, the second electronic device sends the remote viewlogic information associated with the running application to the firstelectronic device, and the first electronic device directly loads anapplication-related interface locally based on the interface layout fileincluded in the remote view logic information. In this way, for thefirst electronic device end, a component, a parameter, and the like thatare related to the running application of the second electronic devicedo not need to be customized on the first electronic device end for therunning application, and only the remote view logic informationtransmitted to the first electronic device needs to be loaded.Distributed application logic may be defined for all runningapplications of the second electronic device on the side of the secondelectronic device, and then the second electronic device synchronizesthe distributed application logic with the first electronic device. Inthis way, application scenarios are numerous.

According to some embodiments of the first aspect of this application,the interface layout file includes an application control related to theapplication.

According to some embodiments of this application, the binding a servicethat is on a side of the second electronic device and that is related tothe application includes:

the first electronic device loads the interface layout file;

the first electronic device constructs a view tree by loading theinterface layout file; and

the first electronic device binds the service related to the applicationin a process of constructing the view tree.

According to some embodiments of the first aspect of this application,the first electronic device locally loads the interface based on aapplication control for the interface layout file.

According to some embodiments of the first aspect of this application,the control information is transferred by the service interfaceexternally disclosed by the service that is on the side of the secondelectronic device and that is bound by the first electronic device andrelated to the application.

According to some embodiments of the first aspect of this application,the first electronic device registers with CallBack related to thesecond electronic device, the first electronic device transfers anICallBack handle to the second electronic device through the serviceinterface, and the second electronic device reversely controls the firstelectronic device by using the ICallBack handle.

According to some embodiments of the first aspect of this application,when running a specific application, the second electronic devicetriggers the coordinated control.

According to some embodiments of the first aspect of this application,when running the application and triggering the coordinated control, thesecond electronic device establishes a data physical channel to thefirst electronic device based on distributed middleware to transmit theremote view logic information.

According to some embodiments of the first aspect of this application,the data physical channel includes a socket channel.

According to some embodiments of the first aspect of this application,before the data physical channel is established between the firstelectronic device and the second electronic device, the first electronicdevice performs device trusted authentication and key credentialexchange on the first electronic device and the second electronic deviceby using the distributed middleware.

According to some embodiments of the first aspect of this application,the distributed middleware separately provides a platform interface forthe second electronic device and the first electronic device, totransfer the remote view logic information through the platforminterface.

According to some embodiments of the first aspect of this application,the second electronic device transfers the remote view logic informationto the first electronic device through the platform interface in a formof a binary digital stream.

According to some embodiments of the first aspect of this application,the platform interface is an interface that implements a cross-processbased on a binder mechanism.

According to some embodiments of the first aspect of this application,the coordinated control method further includes:

the first electronic device unbinds, based on the distributedmiddleware, the service that is bound on the side of the secondelectronic device and that is related to the application.

According to some embodiments of the first aspect of this application,when running the application, the second electronic device refreshes aninterface on the side of the second electronic device based on thecontrol information.

According to a second aspect, an embodiment of this applicationdiscloses a coordinated control system for electronic devices, and thecoordinated control system includes a first electronic device and asecond electronic device.

The first electronic device is used as a controlling party, the secondelectronic device is used as a controlled party, and the firstelectronic device and the second electronic device are connected basedon near field communication.

The second electronic device runs an application and triggerscoordinated control, and sends remote view logic information associatedwith the application to the first electronic device, where the remoteview logic information includes an interface layout file.

The first electronic device receives the remote view logic information,locally loads an interface based on the layout file, and binds a servicethat is on a side of the second electronic device and that is related tothe application.

The first electronic device sends control information to the secondelectronic device based on a service interface externally disclosed bythe service, so that the first electronic device locally controls thesecond device to run the application.

According to the coordinated control system for electronic devicesdisclosed in the second aspect of this application, when triggering thecoordinated control, the second electronic device sends the remote viewlogic information associated with the running application to the firstelectronic device, and the first electronic device directly loads anapplication-related interface locally based on the interface layout fileincluded in the remote view logic information. Distributed applicationlogic may be defined for all running applications of the secondelectronic device on the side of the second electronic device, and thenthe second electronic device synchronizes the distributed applicationlogic with the first electronic device. In this way, applicationscenarios are numerous.

According to some embodiments of the second aspect of this application,when the second electronic device runs the application, the firstelectronic device refreshes an interface on the side of the secondelectronic device based on the control information after receiving aremote assist request. In addition, to remotely refreshing the interfaceon the side of the second electronic device, the first electronic devicemay further perform other control (which may be remote control) on thesecond electronic device. This is not limited in this embodiment of thisapplication.

According to a third aspect, an embodiment of this application disclosesa coordinated control method for electronic devices. The electronicdevices include a first electronic device used as a controlling partyand a second electronic device used as a controlled party that areconnected based on near field communication. The coordinated controlmethod is applied to the second electronic device, and the coordinatedcontrol method includes:

running an application and triggering coordinated control, and sendingremote view logic information associated with the application to thefirst electronic device, where the remote view logic informationincludes an interface layout file;

the first electronic device receives the remote view logic information,locally loads, based on the interface layout file, an interface relatedto the application, and binds a service related to the application; and

the first electronic device sends control information to the secondelectronic device based on a service interface externally disclosed bythe service, so that the first electronic device locally controls thesecond device to run the application.

According to the coordinated control method for electronic devicesdisclosed in the third aspect of this application, when triggering thecoordinated control, the second electronic device sends the remote viewlogic information associated with the running application to the firstelectronic device, and the first electronic device directly loads anapplication-related interface locally based on the interface layout fileincluded in the remote view logic information. In this way, for thefirst electronic device end, a component, a parameter, and the like thatare related to the running application of the second electronic devicedo not need to be customized on the first electronic device end for therunning application, and only the remote view logic informationtransmitted to the first electronic device needs to be loaded.Distributed application logic may be defined for all runningapplications of the second electronic device on the side of the secondelectronic device, and then the second electronic device synchronizesthe distributed application logic with the first electronic device. Inthis way, application scenarios are numerous.

According to a fourth aspect, an embodiment of this applicationdiscloses a coordinated control method for electronic devices. Theelectronic devices include a first electronic device used as acontrolling party and a second electronic device used as a controlledparty that are connected based on near field communication. Thecoordinated control method is applied to the first electronic device,and the coordinated control method includes:

receiving remote view logic information, where the remote view logicinformation is related to a running application of the second electronicdevice, and the remote view logic information includes an interfacelayout file;

locally loading, based on the interface layout file, an interfacerelated to the application, and binding a service related to theapplication; and

the first electronic device sends control information to the secondelectronic device based on a service interface externally disclosed bythe service, so that the first electronic device locally controls thesecond device to run the application.

According to the coordinated control system for electronic devicesdisclosed in the fourth aspect of this application, when triggering thecoordinated control, the second electronic device sends the remote viewlogic information associated with the running application to the firstelectronic device, and the first electronic device directly loads anapplication-related interface locally based on the interface layout fileincluded in the remote view logic information. In this way, for thefirst electronic device end, a component, a parameter, and the like thatare related to the running application of the second electronic devicedo not need to be customized on the first electronic device end for therunning application, and only the remote view logic informationtransmitted to the first electronic device needs to be loaded.Distributed application logic may be defined for all runningapplications of the second electronic device on the side of the secondelectronic device, and then the second electronic device synchronizesthe distributed application logic with the first electronic device. Inthis way, application scenarios are numerous.

Other features and corresponding beneficial effects of the presentinvention are described in a subsequent part of this specification, andit should be understood that at least some beneficial effects becomeapparent from the descriptions in the specification of the presentinvention.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1A is a diagram of a scenario of coordinated control of a mobilephone and a smart TV according to an embodiment of this application;

FIG. 1B is a diagram of a structure of coordinated control of a mobilephone and a smart TV according to an embodiment of this application;

FIG. 1C is a schematic diagram of a structure of distributed middlewareaccording to an embodiment of this application;

FIG. 1D is a schematic diagram of a structure of remote view logicinformation according to an embodiment of this application;

FIG. 2 is a schematic diagram of a structure of a mobile phone accordingto an embodiment of this application:

FIG. 3 is a schematic diagram of a structure of a smart TV according toan embodiment of this application;

FIG. 4A is a diagram 1 of a scenario of coordinated control of a mobilephone and a smart TV according to an embodiment of this application:

FIG. 4B is a flowchart of a coordinated control method for a mobilephone and a smart TV according to an embodiment of this application;

FIG. 4C is a schematic diagram of an interface of a password enteringapplication according to an embodiment of this application:

FIG. 5A is a diagram 2 of a scenario of coordinated control of a mobilephone and a smart TV according to an embodiment of this application;

FIG. 5B is a schematic diagram of an interface of a ball game accordingto an embodiment of this application;

FIG. 5C is a schematic flowchart of a coordinated control method for amobile phone and a smart TV according to an embodiment of thisapplication:

FIG. 6 is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application; and

FIG. 7 is a schematic diagram of a structure of a SOC according to anembodiment of this application.

DESCRIPTION OF EMBODIMENTS

A coordinated control method for electronic devices provided inembodiments of this application may be applied to any electronic devicethat has a display. The electronic devices include but are not limitedto electronic devices such as a mobile phone, a tablet computer, alaptop computer, a desktop computer, a wearable device, a head mounteddisplay, a mobile e-mail device, a portable game console, a portablemusic player, a reader device, a personal digital assistant, a virtualreality device or an augmented reality device, and a television set inwhich one or more processors are embedded or coupled.

A mobile phone 10 and a smart TV 20 are used as examples below todescribe technical solutions of this application according to someembodiments of this application.

The technical solutions provided in embodiments of this application aredescribed below based on FIG. 1A, FIG. 1B, FIG. 1C, and FIG. 1D.

As shown in FIG. 1A, a mobile phone 10 used as a controlling party and asmart TV 20 used as a controlled party communicate with each other basedon a near field communication. Networking methods include but are notlimited to wireless fidelity peer-to-peer (Wi-Fi P2P) communication,Bluetooth P2P communication, local area network communication, Wi-Ficommunication, and the like. In this embodiment of this application, asan example, the Wi-Fi P2P communication manner between the mobile phone10 and the smart TV 20 is used to implement communication between themobile phone 10 and the smart TV 20 and coordinated control between themobile phone 10 and the smart TV 20.

Based on an application scenario provided in this embodiment of thisapplication, the smart TV 20 locally runs an application as thecontrolled party. For the locally running application, the smart TV 20sends remote view logic information associated with the locally runningapplication to the mobile phone 10. The remote view logic informationincludes an interface layout file (such as a application control for thelocally running application) of the application locally running on thesmart TV 20. After receiving the remote view logic information, themobile phone 10 locally loads, based on the interface layout file, aninterface (such as the application control and a display interface forthe application locally running on the smart TV 20) related to theapplication locally running on the smart TV 20. When the mobile phone 10loads the remote view logic information, the mobile phone 10 binds aservice that is on a side of the smart TV 20 and that is related to thelocally running application. Therefore, the mobile phone 10 sendscontrol information to the smart TV 20 based on an interface disclosedby the bound service, so that the mobile phone 10 controls, based on thecontrol information, the smart TV 20 to nm the application. It should benoted that the remote view logic information may be customized by thesmart TV 20. The interface layout file in the remote view logicinformation may be the same as an interface layout of the applicationlocally running on the smart TV 20, and the interface layout file in theremote view logic information may alternatively be different from theinterface layout of the application locally running on the smart TV 20.This is not limited in this embodiment of this application.

According to some embodiments of this application, a service componentis defined on a side of the mobile phone 10 based on the remote viewlogic information, and the service component includes but is not limitedto a service component of an Android system. Certainly, the servicecomponent may alternatively be another type based on an actual usesituation. This is not limited in this embodiment of this application.

According to some embodiments of this application, networking betweenthe mobile phone 10 and the smart TV 20 is a prerequisite forcommunication between the mobile phone 10 and the smart TV 20. As shownin FIG. 1B, the mobile phone 10 and the smart TV 20 may be networked inthe Wi-Fi P2P communication method based on a near field communicationnetwork.

After the mobile phone 10 and the smart TV 20 are networked based onWi-Fi P2P, a connection is established between the mobile phone 10 andthe smart TV 20 to transmit the remote view logic information. That theconnection is established between the mobile phone 10 and the smart TV20 may be: When the smart TV 20 runs a specific application, thespecific application triggers the smart TV 20 to connect to the mobilephone 10; or when both the mobile phone 10 and the intelligent device 20are in a same near field network, a host module of the smart TV 20 and ahost module of the mobile phone 10 are triggered, so that the smart TV20 and the mobile phone 10 are connected by using the host module of thesmart TV 20 and the host module of the mobile phone 10.

According to some embodiments of this application, that the specificapplication triggers to connect the smart TV 20 and the mobile phone 10is specifically: When the smart TV 20 is switched to the specificapplication and runs the specific application, coordinated control istriggered. The smart TV 20 performs trusted authentication and keycredential exchange on the mobile phone 10 based on distributedmiddleware. After the smart TV 20 and the mobile phone 10 completetrusted authentication and key credential exchange, a data physicalchannel (which may be a socket physical channel) is established betweenthe smart TV 20 and the mobile phone 10 based on the distributedmiddleware, to complete the connection. It should be noted that a methodof establishing the connection between the mobile phone 10 and the smartTV 20 is not limited to socket communication, but may be another method.This is not limited in this embodiment of this application.

Based on the mobile phone 10 and the smart TV 20 that are connected, thesmart TV 20 locally runs the application, and sends the remote viewlogic information of the locally running application to the mobile phone10.

The remote view logic information shown in FIG. 1D includes but is notlimited to the interface layout file, application package configurationinformation, and a dex file. The interface layout file includes anapplication control related to the application locally running on thesmart TV 20. The application package configuration information includesa configuration parameter of an application program of the locallyrunning application. The dex file includes a customized containercontrol, related application logic code, and a CallBack class. It shouldbe noted that the entire remote view logic information may be anapplication apk file, or may be a packaged binary file.

According to some embodiments of this application, the mobile phone 10locally loads an interface (an interface of the application locallyrunning on the smart TV 20) based on the remote view logic information,and binds a service of the application locally running on the smart TV20. A process of locally loading the interface is specifically asfollows: The mobile phone 10 constructs a view tree while loading theinterface, and binds, in a process of constructing the view tree, theservice of the application locally running on the smart TV 20.

The mobile phone 10 registers with a CallBack object after binding theservice related to the locally running application.

Based on the bound service of the application locally running on thesmart TV 20, the mobile phone 10 refreshes an interface on the side ofthe smart TV 20 while operating the locally loaded interface. The smartTV 20 reversely controls the mobile phone 10 by using ICallBack relatedto CallBack (which may be that the smart TV 20 reversely refreshes aninterface on the side of the mobile phone 10). It should be noted thatin addition to remotely refreshing the interface on the side of themobile phone 10, the smart TV 20 may further perform other control(which may be remote control) on the mobile phone 10. This is notlimited in this embodiment of this application.

The smart TV 20 may alternatively operate a local partial window of thesmart TV 20 by reversely refreshing an interface loaded on the side ofthe mobile phone 10.

According to some embodiments of this application, as shown in FIG. 1C,a structure of the distributed middleware includes but is not limited tothe following modules.

A NetWorkManager network management module is configured to providesupport for networking between the mobile phone 10 and the smart TV 20,authentication and key credential exchange between the mobile phone 10and the smart TV 20, and a device connection between the mobile phone 10and the smart TV 20.

A DManager module provides some platform interfaces for the mobile phone10 or the smart TV 20. The platform interfaces include but are notlimited to an interface used by the mobile phone 10 to bind a remoteservice on the side of the smart TV 20, an interface used by the mobilephone 10 to unbind the remote service on the side of the smart TV 20, aninterface used by the mobile phone 10 to transfer the remote view logicinformation to the smart TV 20 (the interface may be an interface (abinder interface) that implements a cross-process based on a bindermechanism), and the like.

A DBinder module is packaged based on an Android binder mechanism, andcan convert an original cross-process binder into a cross-device (themobile phone 10 and the smart TV 20) binder. That the smart TV 20invokes a binder interface of the mobile phone 10 is similar tolocalized binder invocation. For a host on the side of the mobile phone10, inside a Dbinder, parameter data invoked by using a binder interfaceon the side of the smart TV 20 (which may be that the remote view logicinformation is transferred to the first electronic device in a form of abinary digital flow) is converted into a binary digital flow, and thebinary digital flow is transferred to the mobile phone 10 through a dataphysical channel (a socket channel). To implement concurrent invoking ofa plurality of binder interfaces, a thread pool and a list of a seriesof sub-threads may be designed in the DBinder module. A binder threadspecification externally provided by the DBinder for cross-processbinder invoking is consistent with a thread specification scheduled by anative platform binder.

According to some embodiments of this application, as shown in FIG. 1C,when the host on the side of the mobile phone 10 invokes a platforminterface on the side of the smart TV 20, an invoked data parameterpasses through the data physical channel (socket communication) twice.

According to the coordinated control method for electronic devicesdisclosed in this embodiment of this application, when triggering thecoordinated control, the smart TV sends the remote view logicinformation associated with the running application to the mobile phone,and the mobile phone directly loads an application-related interfacelocally based on the interface layout file included in the remote viewlogic information. In this way, for the first electronic device end, acomponent, a parameter, and the like that are related to the runningapplication of the second electronic device do not need to be customizedon the first electronic device end for the running application, and onlythe remote view logic information transmitted to the first electronicdevice needs to be loaded. Distributed business logic may be defined forall running applications of the second electronic device on the side ofthe second electronic device, and then the second electronic devicesynchronizes the distributed application logic with the first electronicdevice. In this way, application scenarios are numerous.

As an example below, the mobile phone 10 and the smart TV 20 are theelectronic devices, to describe in detail the coordinated control methodfor electronic devices provided in embodiments of this application.

First, FIG. 2 is a schematic diagram of a structure of a mobile phone.

The mobile phone 10 may include a processor 110, an external memoryinterface 120, an internal memory 121, an antenna 1, an antenna 2, amobile communication module 150, a wireless communication module 160,and a display 170.

It may be understood that the structure shown in this embodiment of thepresent invention does not constitute a specific limitation on themobile phone 10. In some other embodiments of this application, themobile phone 10 may include more or fewer components than those shown inthe figure, or some components may be combined, or some components maybe split, or there may be a different component arrangement. Thecomponents shown in the figure may be implemented by using hardware,software, or a combination of software and hardware.

The processor 110 may include one or more processing units. For example,the processor 110 may include an application processor (AP), a modemprocessor, a graphics processing unit (GPU), an image signal processor(ISP), a controller, a video codec, a digital signal processor (DSP), abaseband processor, a neural-network processing unit (NPU), and/or thelike. Different processing units may be independent devices, or may beintegrated into one or more processors.

The controller may generate an operation control signal based oninstruction operation code and a time sequence signal, to completecontrol of instruction reading and instruction execution.

A memory may be further disposed in the processor 110, and is configuredto store instructions and data. In some embodiments, the memory in theprocessor 110 is a cache. The memory may store instructions or data justused or cyclically used by the processor 110. If the processor 110 needsto use the instructions or the data again, the processor may directlyinvoke the instructions or the data from the memory. This avoidsrepeated access, reduces waiting time of the processor 110, and improvessystem efficiency. For this embodiment of this application, afterreceiving remote view logic sent by a smart TV 20, the processor 110executes the instructions stored in the processor. Through theinstructions, an application-related interface is locally loaded basedon an interface layout file in the remote view logic, and a serviceinterface that is on a side of the smart TV 20 and that is related to alocally running application is bound.

A wireless communication function of the mobile phone 10 may beimplemented by using the antenna 1, the antenna 2, the mobilecommunication module 150, the wireless communication module 160, themodem processor, the baseband processor, and the like.

The antenna 1 and the antenna 2 are configured to transmit and receiveelectromagnetic wave signals. Each antenna in the mobile phone 10 may beconfigured to cover a single communication frequency band or a pluralityof communication frequency bands. Different antennas may be furthermultiplexed, to improve antenna utilization. For example, the antenna 1may be multiplexed as a diversity antenna in a wireless local areanetwork. In some other embodiments, an antenna may be used incombination with a tuning switch.

The mobile communication module 150 may provide a solution to wirelesscommunication such as 2G/3G/4G/5G that is applied to the mobile phone10. The mobile communication module 150 may include at least one filter,a switch, a power amplifier, a low noise amplifier (LNA), and the like.The mobile communication module 150 may receive an electromagnetic wavethrough the antenna 1, perform processing such as filtering oramplification on the received electromagnetic wave, and transmit theelectromagnetic wave to the modem processor for demodulation. The mobilecommunication module 150 may further amplify a signal modulated by themodem processor, and convert the signal into an electromagnetic wave forradiation through the antenna 1. In some embodiments, at least somefunctional modules of the mobile communication module 150 may bedisposed in the processor 110. In some embodiments, at least somefunctional modules of the mobile communication module 150 may bedisposed in a same device as at least some modules of the processor 110.

The wireless communication module 160 may provide a wirelesscommunication solution that is applied to the mobile phone 10, and thatincludes a wireless local area network (WLAN) (for example, a wirelessfidelity (Wi-Fi) network). Bluetooth (BT), a global navigation satellitesystem (GNSS), frequency modulation (FM), a near field communication(NFC) technology, an infrared (IR) technology, or the like, to implementnetworking with the smart TV 10. The wireless communication module 160may be one or more components integrating at least one communicationprocessing module. The wireless communication module 160 receives anelectromagnetic wave through the antenna 2, performs frequencymodulation and filtering processing on an electromagnetic wave signal,and sends a processed signal to the processor 110. The wirelesscommunication module 160 may further receive a to-be-sent signal fromthe processor 110, perform frequency modulation and amplification on thesignal, and convert the signal into an electromagnetic wave forradiation through the antenna 2.

In some embodiments, the antenna 1 of the mobile phone 10 is coupled tothe mobile communication module 150, and the antenna 2 is coupled to thewireless communication module 160, so that the mobile phone 10 cancommunicate with a network and another device by using a wirelesscommunication technology. The wireless communication technology mayinclude a global system for mobile communications (GSM), a generalpacket radio service (GPRS), code division multiple access (CDMA),wideband code division multiple access (WCDMA), time-division codedivision multiple access (timeTD-SCDMA), long term evolution (LTE), BT,a GNSS, a WLAN, NFC, FM, an IR technology, and/or the like. The GNSS mayinclude a global positioning system (GPS), a global navigation satellitesystem (GLONASS), a BeiDou navigation satellite system (BDS), aquasi-zenith satellite system (QZSS), and/or a satellite basedaugmentation system (SBAS).

The mobile phone 10 implements a display function by using the GPU, thedisplay 170, the application processor, and the like. The GPU is amicroprocessor for image processing, and is connected to the display 170and the application processor. The GPU is configured to: performmathematical and geometric calculation, and render an image. Theprocessor 110 may include one or more GPUs that execute programinstructions to generate or change display information.

The display 170 is configured to display an interface that is includedin the remote view logic information and that is related to aapplication run by the smart TV 10. The display 170 includes a displaypanel. The display panel may be a liquid crystal display (LCD), anorganic light-emitting diode (OLED), an active-matrix organic lightemitting diode (AMOLED), a flexible light-emitting diode (FLED), amini-LED, a micro-LED, a micro-OLED, a quantum dot light emitting diode(QLED), or the like. In some embodiments, the mobile phone 10 mayinclude one or N displays 170, and N is a positive integer greater than1.

The external memory interface 120 may be configured to connect to anexternal storage card, for example, a micro SD card, to extend a storagecapability of the mobile phone 10. The external storage cardcommunicates with the processor 110 through the external memoryinterface 120, to implement a data storage function. For example, theremote view logic information transferred by the smart TV 20 is storedin the external storage card.

The internal memory 121 may be configured to store computer-executableprogram code. The executable program code includes instructions. Theinternal memory 121 may include a program storage area and a datastorage area. The program storage area may store an operating system, anapplication required by at least one function (for example, a soundplaying function or an image playing function), and the like. The datastorage area may store data (such as audio data and a phone book) andthe like created during use of the mobile phone 10. In addition, theinternal memory 121 may include a high-speed random access memory, andmay further include a nonvolatile memory, for example, at least onemagnetic disk storage device, a flash memory, or a universal flashstorage (UFS). The processor 110 runs instructions stored in theinternal memory 121 and/or instructions stored in the memory disposed inthe processor, to perform various function applications and dataprocessing of the mobile phone 10.

FIG. 3 is a schematic diagram of a structure of a smart TV according toan embodiment of this application.

A smart TV 20 may include a processor 220, an external memory interface221, an internal memory 222, an antenna 3, an antenna 4, a wirelesscommunication module 223, a display 224, and the like.

It may be understood that the structure shown in this embodiment of thepresent invention does not constitute a specific limitation on the smartTV 20. In some other embodiments of this application, the smart TV 20may include more or fewer components than those shown in the figure, orsome components may be combined, or some components may be split, orthere may be a different component arrangement. The components shown inthe figure may be implemented by using hardware, software, or acombination of software and hardware.

For detailed descriptions of the processor 220, the external memoryinterface 221, the internal memory 222, the antenna 3, the antenna 4,the wireless communication module 223, the display 224, and the like ofthe smart TV 20, correspondingly refer to descriptions of the mobilephone 10. Details are not described in this embodiment of thisapplication.

The external memory interface 221 may be configured to connect to anexternal storage card such as a micro SD card, to extend a storagecapability of the smart TV 20. The external storage card communicateswith the processor 220 through the external memory interface 221, toimplement a data storage function. For example, a cache file generatedby a locally running application is stored in the external storage card.

The internal memory 222 may be configured to store computer-executableprogram code. The executable program code includes instructions. Theinternal memory 222 may include a program storage area and a datastorage area. The program storage area may store an operating system.The data storage area may store data (such as audio data and a video)and the like created during use of the smart TV 20. In addition, theinternal memory 222 may include a high-speed random access memory, andmay further include a nonvolatile memory, for example, at least onemagnetic disk storage device, a flash memory, or a universal flashstorage (UFS). The processor 220 runs instructions stored in theinternal memory 222 and/or instructions stored in the memory disposed inthe processor, to perform various function applications and dataprocessing of the smart TV 20.

Technical solutions of embodiments of this application are describedbelow with reference to specific scenarios.

Scenario 1:

In scenario 1, for example, electronic devices are a mobile phone 10 anda smart TV 20. In scenario 1, a locally running application of anapplication host on a side of the smart TV 20 is a text editionapplication (which may be used as a specific application). A processor220 on the side of the smart TV 20 displays a text edition interface ona local display 224 based on the text edition application. The processor220 on the side of the smart TV 20 triggers coordinated control, andbroadcasts a device connection request. The mobile phone 10 establishesa communication connection to the smart TV 20 based on the deviceconnection request and binds a service that is in the smart TV 20 andthat is related to the text edition application. The smartTV 20 sendsremote view logic information that includes the text edition interfaceto the mobile phone 10 through an established communication channel. Aprocessor 110 of the mobile phone 10 locally loads a local window (thetext edition interface of the smart TV) of the text edition applicationof the application host on the side of the smart TV 20 based on theremote view logic information. The processor of the mobile phone 10controls a display 170 to display an interface of the text editionapplication. In addition, when entering text in the local text editioninterface, the mobile phone 10 synchronizes the entered text with thetext edition interface on the side of the smart TV 20 in real time byusing a bound service related to the text edition application. It shouldbe noted that another type of application may run on the side of thesmart TV 20. This embodiment of this application is not limited to thetext edition application. In addition, the mobile phone 10 may alsoperform another operation on the loaded local text edition interface.This embodiment of this application is not limited to an operation ofentering text.

Refer to FIG. 4A, FIG. 4B, and FIG. 4C. FIG. 4A is a diagram 1 of ascenario of coordinated control of a mobile phone and a smart TVaccording to an embodiment of this application. FIG. 4B is a flowchartof a coordinated control method for a mobile phone and a smart TVaccording to an embodiment of this application. FIG. 4C is a schematicdiagram of an interface of a password entering application according toan embodiment of this application. The coordinated control method forthe mobile phone and the smart TV in this embodiment of this applicationis described in detail below with reference to FIG. 4A, FIG. 4B, andFIG. 4C.

As shown in FIG. 4A, a smart TV end 20 includes but is not limited to anapplication host and distributed middleware. The application hostincludes but is not limited to a text edition interface control, aservice component, and an ICallBack object. A mobile phone end 10includes but is not limited to a host module and distributed middleware.The host module includes but is not limited to a CallBack object. TheICallBack object and the CallBack object are in a relationship of a hostand a server. The smart TV 20 may reversely refresh a text editioninterface of a locally running application of the mobile phone 10 byusing the ICallBack object. Networking of the smart TV 20 and the mobilephone 10, a connection between the mobile phone 10 and the smart TV 20,trusted authentication between the mobile phone 10 and the smart TV 20,data transfer between the mobile phone 10 and the smart TV 20, and acapability of invoking a binder interface between the mobile phone 10and the smart TV 20 are implemented by using the distributed middleware.

According to some embodiments of this application, when a user on thesmart TV end 20 switches to a text edition application, a side of thesmart TV 20 sends a device connection request broadcast to the mobilephone 10 in a same local area network by using the distributedmiddleware on the side of the smart TV 20. After a side of the mobilephone 10 receives the device connection request broadcast, thedistributed middleware on the side of the mobile phone 10 sends amessage to the host module of the mobile phone 10. The host module(which is an application module for receiving and loading remote viewlogic information) sends a device connection notification message to thesmart TV 20 based on the device connection request broadcast by usingthe distributed middleware. The host module of the mobile phone 10invokes a platform interface (which can provide a binder handle objectas a binder interface) provided by the distributed middleware of themobile phone 10, to connect to the smart TV 20 (a socket physicalchannel may be created by using a socket). The smart TV 20 sends theremote view logic information based on a socket physical channelprovided by the distributed middleware. The host module of the mobilephone 10 locally loads the text edition interface on the side of thesmart TV 20 based on the remote view logic information, registers withthe CallBack object, and binds the service component (with a remoteservice function) of the smart TV 20 in a process of loading a viewtree. The mobile phone 10 synchronizes control information (refresh dataof a locally loaded text edition application (such as text entered bythe user in the text edition interface)) with the text edition interfaceof the smart TV 20 by using a service interface. In addition, the smartTV 20 may further reversely synchronize text or other information withthe mobile phone 10 by using the ICallBack object.

As shown in FIG. 4B, the coordinated control method for the mobile phoneand the smart TV includes the following steps.

Step S40: When operating the application host of the smart TV 20 byusing a remote control, the user on the side of the smart TV 20 switchesthe smart TV 20 to the text edition application, and displays a textedition interface on a display of the smart TV 20.

Step S41: The distributed middleware on the side of the smart TV 20sends a device connection request broadcast. A device connection requestsent by the smart TV 20 is in a local area network in which the smart TV20 is located, and when the mobile phone 10 and the smart TV 20 are in asame local area network, the device connection request broadcast sent bythe smart TV may be received.

Step S42: The distributed middleware on the side of the mobile phone 10receives the device connection request broadcast sent by the distributedmiddleware of the smart TV 20, and the distributed middleware on theside of the mobile phone 10 sends the device connection requestbroadcast to the host module on the side of the mobile phone 10.

Step S43: The host module on the side of the mobile phone 10 sends adevice connection notification message based on the device connectionrequest broadcast.

Step S44: The user taps the device connection notification message(triggers a touch instruction) on a display 170 of the mobile phone 10.

Step S45: A processor of the mobile phone 10 controls, based on thetouch instruction, the host module of the mobile phone 10 to invoke aninterface that is for device authentication and a device connection andthat is of the distributed middleware on the side of the mobile phone10.

Step S46: The distributed middleware of the mobile phone 10 performsdevice authentication and key credential exchange on the smart TV 20,and then implements a device connection to the smart TV 20 by using theconnection interface of the distributed middleware.

According to some embodiments of this application, in a process ofestablishing a device connection on the side of the mobile phone 10, themobile phone 10 and the smart TV 20 each transfer a service list with aremote invoking capability to a peer end. A process in which the mobilephone 10 and the smart TV 20 transmit the service list includes twosteps: Step 1 is that the mobile phone 10 or the smart TV 20 queries aservice list with a remote capability by using an Android packet managerservice interface. Step 2 is that the mobile phone 10 or the smart TV 20transmits the remote service list to a peer end by using an interfaceprovided by the distributed middleware. In this way, when the smart TV20 runs an application and the mobile phone 10 needs to bind a serviceof the smart TV 20, the mobile phone 10 first queries, from a memory ofthe mobile phone 10, whether the service list with the remote invokingcapability that is transmitted by the smart TV 20 is served by a remoteend, and then binds the service on the side of the smart TV 20 by usingthe distributed middleware on the side of the mobile phone 10.

Step S47: After the smart TV 20 and the mobile phone 10 are connected,the smart TV 20 sends remote view logic information to the distributedmiddleware on the side of the smart TV 20.

According to some embodiments of this application, the remote view logicinformation is an application structure, and is packaged into animplementation of an apk compressed package by using an Android systemapk packaging tool aapt. The compressed package includes three files: anapplication package configuration information file (such as anapplication package for editing text), an interface layout file (a textedition interface), and a dex file. The dex file includes a customizedcontainer control and a CallBack class. In addition, the remote viewlogic information may alternatively be generated after being packaged byusing another tool. This is not limited in this embodiment of thisapplication.

The interface layout file in the remote view logic information iscustomized by the application host on the side of the smart TV 20, andis a part of an edition window layout of the smart TV 20. Optionally,for a text edition application, the interface layout file in the remoteview logic information may include a text input control EditText, or mayinclude two controls: a text input control EditText and a text promptcontrol TextView. The interface layout file may alternatively use acontainer control of an extended standard template of an Android system.A specific type selected for the container control is defined by abusiness based on a requirement. A window interface on the side of themobile phone 10 and a window interface on the side of the smart TV 20are bound with a same service related to the text edition application.Synchronization of a window layout file control status (such as a changein a shape of the text input control EditText) and information (such astext entered in the text input control) on the side of the mobile phone10 and the side of the smart TV 20 may be implemented by using a serviceinterface externally disclosed by the bound service. In addition, theinterface layout file in the remote view logic information may furtherinclude another control. A type of the control is not limited in thisembodiment of this application.

According to some embodiments of this application, the text editionapplication on the side of the smart TV 20 is a password enteringapplication. As shown in FIG. 4C, after the text input control EditText(a password entering text edition box) is displayed on a display 224,the side of the smart TV 20 sends the remote view logic information tothe mobile phone 10. The side of the mobile phone 10 locally loads,based on the remote view logic information, the password entering textedition box that adapts to the smart TV 20. When locally refreshing thepassword entering text edition box or enters text in the passwordentering text edition box, the mobile phone 10 synchronizes a refreshinterface with the side of the smart TV 20 in real time.

It can be learned based on FIG. 4C that when running the passwordentering Kibbitz, the side of the smart TV 20 displays the text promptcontrol TextView “Please enter the password”, the password entering textedition box, a control “OK”, and a text prompt control “Tap the homescreen button to return to the home screen” on an interface. It may beunderstood that other more controls may be further customized on theinterface displayed on the side of the smart TV 20. This is not limitedin this embodiment of this application.

According to some embodiments of this application, related definitionssuch as width and height of the text prompt control, the passwordentering text edition box, the confirm control, and the like may bedefined by using parameters of a linear layout.

For example, CustomView is a customized control class name, and is acontainer control, and includes a text prompt control, a text editionbox, and a button. A customized control defines width and height of thecontainer control, and is consistent with a parent container.

For the text prompt control TextView “Please enter the password”, threefields are ID, width, and height.

A linear layout container is defined under the text prompt control. Thecontainer control includes but is not limited to a text edition box anda control “OK”.

The password entering text edition box is defined as follows: Fourfields are ID, width, height, and type of entered text.

The control “OK” is defined as follows: Four fields are ID, width,height, right alignment manner, and display a text definition.

Certainly, the password entering application or another application mayalternatively have other more definitions. This is not limited in thisembodiment of this application.

It may be understood that other more controls may be further customizedon the interface displayed on the side of the smart TV 20, and anotherdefinition manner may be used. This is not limited in this embodiment ofthis application.

In this embodiment of this application, the interface layout file in theremote view logic information transferred by the smart TV 20 includes aview tree. The view tree may be used as a part of the text editioninterface on the side of the smart TV 20, and the interface layout filemay also be independently defined by a application based on applicationlogic. This is not limited in this embodiment of this application. Theinterface layout file may include the text input control EditText, ormay include some other controls, to implement diversity of remoteinterface coordination. Optionally, for ease of development, a layout ofthe remote view logic information may use some container controls with aremote control capability based on an extended definition of the Androidsystem. In addition, a structure of the remote view logic informationhas remote access invoking logic information. While loading the remoteview logic information, the side of the mobile phone 10 binds a remoteservice on the side of the smart TV 20. Through the remote service,control information can be transferred between the mobile phone 10 andthe smart TV 20. In this way, a controlled interface invoking method isused between the mobile phone 10 and the smart TV 20, so that a delay issmall, and coordination experience between the mobile phone 10 and thesmart TV 20 is good.

Step S48: In response to the remote view logic information, thedistributed middleware on the side of the smart TV 20 sends the remoteview logic information (the interface layout file in the remote viewlogic information includes the text prompt control TextView “Pleaseenter the password”, the password entering text edition box, and thecontrol “OK”) on the side of the smart TV 20 to the distributedmiddleware on the side of the mobile phone 10.

Step S49: After receiving the remote view logic information, thedistributed middleware on the side of the mobile phone 10 transfers theremote view logic information to the host module on the side of themobile phone 10.

Step S50: The host module on the side of the mobile phone 10 loads theinterface layout file based on the remote view logic information, andgenerates a local window in a process of loading the interface layoutfile. A view tree is constructed in the local window, and the view treeincludes the text prompt control TextView “Please enter the password”,the password entering text edition box, and the control “OK”, so that aninterface related to the text input application is locally displayed onthe side of the mobile phone 10.

Step S51: The side of the mobile phone 10 loads the view tree in aprocess of loading the local window, the host module on the side of themobile phone 10 requests, based on the loaded view tree, to bind theservice with the remote invoking capability on the side of the smart TV20, and the mobile phone 10 sends a service binding request to thedistributed middleware on the side of the smart TV 20 by using thedistributed middleware on the side of the mobile phone 10.

Step S52: The distributed middleware on the side of the smart TV 20sends the service binding request of the distributed middleware on theside of the mobile phone 10 to the application host of the smart TV 20.In response to the service binding request, the application host binds aservice related to the text input application.

Step S53: After the service is bound on the side of the smart TV 20, themobile phone loads the view tree to bind the service of the smart TV 20and registers with a CallBack service object.

Step S54: The mobile phone 10 obtains an aidl interface binder handleobject (a binder interface) returned by the application host on the sideof the smart TV 20, so that the mobile phone 10 may transfer a controlmessage to the smart TV 20 by using the binder handle object, and themobile phone 10 assists the smart TV 20 in entering text. In addition,the smart TV 20 may further reversely control the mobile phone 10 (forexample, refresh an interface of the mobile phone 10) by using theICallBack.

In the technical solution in scenario 1, while loading the remote viewlogic information, the side of the mobile phone 10 binds the remoteservice on the side of the smart TV 20. Through the remote service,control information can be transferred between the mobile phone 10 andthe smart TV 20. In this way, a controlled interface invoking method isused between the mobile phone 10 and the smart TV 20, so that a delay issmall, and the coordination experience between the mobile phone 10 andthe smart TV 20 is good.

A layout on the interface on the side of the smart TV 20 may becustomized by the side of the smart TV 20. After being locallyconstructed, the layout customized by the side of the smart TV 20 issent to the mobile phone 10 in a form of the remote view logicinformation. The mobile phone 10 only needs to load the remote viewlogic information to locally load the interface. There is no need tocustomize, on the side of the mobile phone for the text inputapplication of the smart TV, a component and a parameter that arerelated to the text input application, and only the remote view logicinformation transmitted by the smart TV needs to be loaded. Distributedapplication logic can be defined for all running applications of thesmart TV on the side of the smart TV, and then the smart TV synchronizesthe distributed application logic with the mobile phone. In this way,application scenarios are numerous.

The ICallBack object on the side of the smart TV 20 and the CallBackobject on the side of the mobile phone are in a relationship of a hostand a server. The smart TV 20 may reversely refresh, by using theICallBack object, a text edition interface or other information of alocally running application of the mobile phone 10.

Scenario 2:

In scenario 2, for example, the electronic devices area mobile phone 10and a smart TV 20. In scenario 2, a locally running application of anapplication host on a side of the smart TV 20 is a ball game. Aprocessor 220 on the side of the smart TV 20 displays a ball gameinterface on a local display 224 based on the ball game. The processor220 on the side of the smart TV 20 triggers coordinated control, andbroadcasts a device connection request by using distributed middleware,and the mobile phone 10 receives the device connection request by usingdistributed middleware of the mobile phone 10, and establishes acommunication connection to the smart TV 20 based on the deviceconnection request. The smart TV 20 sends remote view logic informationthat includes the ball game to the mobile phone 10 through anestablished communication channel. A processor 110 of the mobile phone10 locally loads, based on the remote view logic information, a localwindow (the ball game interface on the side of the smart TV 20) relatedto the ball game of the application host on the side of the smart TV 20.It should be noted that scenario 2 may alternatively be a technicalsolution in which two mobile phones 10 implements scenario 2, and a typeof the electronic device is not limited in this embodiment of thisapplication.

The processor of the mobile phone 10 controls a display 170 to displaythe ball game interface. When operating a game slider control on thelocal ball game interface, the mobile phone 10 synchronously refreshes,in real time, a status of the game slider control and a current gameinterface of the ball game to the ball game interface on the side of thesmart TV 20 by using a bound service related to the ball game. Whenoperating the local game interface on the side of the smart TV 20, theside of the smart TV 20 reversely synchronizes a game refresh interfaceon the side of the smart TV 20 with the side of the mobile phone 10. Itshould be noted that another type of application may run on the side ofthe smart TV 20. This embodiment of this application is not limited tothe ball game application.

Refer to FIG. 5A, FIG. 5B, and FIG. 5C. FIG. 5A is a diagram 2 of ascenario of coordinated control of a mobile phone and a smart TVaccording to an embodiment of this application. FIG. 5B is a schematicdiagram of an interface of a ball game according to an embodiment ofthis application. FIG. 5C is a schematic flowchart of a coordinatedcontrol method for a mobile phone and a smart TV according to anembodiment of this application. The coordinated control method for themobile phone and the smart TV in this embodiment of this application isdescribed in detail below with reference to FIG. 5A, FIG. 5B, and FIG.5C.

As shown in FIG. 5A and FIG. 5B, a host APP of the smart TV 20 and ahost APP of the mobile phone 10 are used to display a ball gameinterface, and the host APP includes a view tree and a Session.stubserver. For the ball game in scenario 2 of this application, view treeson a side of the smart TV 20 and the mobile phone 10 include but are notlimited to a grid block container control 500 and a grid block containercontrol 501 (6×8 sub-grid blocks are arranged based on rows andcolumns), a ball control 51, and a slider control 52 on the side of thesmart TV 20 or a slider control 53 on a side of the mobile phone 10. Abutton control 502 and a scoring control 503 are reset. The slidercontrol 52 and the slider control 53 are respectively manipulationcontrols on the side of the smart TV 20 and the side of the mobile phone10. Both the slider control 52 and the slider control 53 may respond toan input event, and the input event may be a sensor event or a TP event.The sensor event is three-dimensional coordinate information uploaded bya pressure sensor, a gyroscope, and the like of the smart TV 20 and themobile phone 10. The TP event is a screen touch event in which a usertouches the smart TV 20 and the mobile phone 10.

According to some embodiments of this application, the side of the smartTV 20 and the side of the mobile phone 10 may control a position of theball control 51 by using the slider control 52. The game interface onthe side of the smart TV 20 may be synchronized with the side of themobile phone 10, and the game interface on the side of the mobile phone10 may be synchronized with the side of the smart TV 20.

When the ball control 51 touches a sub-grid block in the grid blockcontainer control 500 or a sub-grid block in the grid block containercontrol 501 on respective interfaces, the sub-grid block that is in thegrid block container control 500 or the sub-grid block that is in thegrid block container control 501 and that is touched by the ball control51 disappears, and victory or defeat of the ball game is determined(which may be: if the sub-grid block that is in the grid block containercontrol 500 and that is touched by the ball control 51 correspondinglydisappears or the sub-grid block that is in the grid block containercontrol 501 and that is touched by the ball control 51 correspondinglydisappears, a scoring control on a corresponding game interface gets afew points; or may be: if the ball control collides with the sub-gridblock in the grid block container control 500 or the sub-grid block inthe grid block container control 501 once, 1 point is got, and a scoreis increased in sequence). If a specific score (which may be customized)is not reached on the side of the mobile phone 10 and the side of thesmart TV 20 within specified time, the ball game is invalid.

The slider control 52 of the ball game is to be operated by the smart TV20, and the slider control 53 is to be operated by the mobile phone 10.To be specific, the smart TV 20 and the mobile phone 10 may affectpositions of the slider control 52 and the slider control 53 based onthe TP event or the sensor input event. When the ball control 51 or aball control 54 falls to the bottom of respective windows, the ballcontrol 51 or the ball control 54 collides with the respective slidercontrol 52 or slider control 53, and the ball control 51 bounces backafter collision. A bounce path is related to a speed and a collisionposition and angle.

A game process of the ball game is specifically as follows: The smart TV20 and the mobile phone 10 respectively control the respective slidercontrol 52 and slider control 53; if the slider control 52 collides withthe ball control 51 so that the ball control 51 is in contact with thesub-grid block in the grid block container control 500 in the gameinterface of the smart TV 20, the smart TV 20 scores; and if the slidercontrol 53 collides with the ball control 51 so that the ball control 51collides with the sub-grid block in the grid block container control501, the mobile phone 10 scores. A party with a higher score withinspecified time wins. Optionally, a host APP and a game APP of the ballgame may be implemented by a same application process.

It should be noted that users of the two devices: the smart TV 20 andthe mobile phone 10, respectively operate the slider control 52 and theslider control 53 that belong to the users, and cannot operate a slidercontrol of the other party. For example, when the user of the smart TV20 operates the slider control 52 and the slider control 52 collideswith the ball control 51, the ball control 51 bounces back, and when theball control 51 collides with the grid block container control 500, theball game scores for the user of the smart TV 20 and displays a score inthe scoring control. When the user of the mobile phone 10 operates theslider control 53 and the slider control 53 collides with the ballcontrol 51, the ball control 51 bounces back, and when the ball control51 collides with the grid block container control 501, the ball gamescores for the user of the mobile phone 10. A user of a device with ahigher score within specific time wins.

As shown in FIG. 5A, the Session.stub server included in the host APP ofthe smart TV 20 is bound to a service (which may be a session service)in the game APP (an application of the ball game) on the side of thesmart TV 20 in a process of constructing a view tree on the side of thesmart TV 20, and transfers an ISession mLocal handle in the sessionservice to the game APP by using an aidl interface provided externallyby the service. In this way, the game APP controls to update theinterface of the ball game on the side of the smart TV 20 by using anISession mLocal handle object.

The side of the smart TV 20 further includes a game APP. The game APP isresponsible for managing application logic management of the ball game.The game APP includes a service component and a GameSession module. TheGameSession module manages an Isession mLocal handle and an IsessionmRemote handle. A session mLocal handle is used to refresh the ball gameinterface of the host APP of the smart TV 20, and the Isession mRemotehandle is used to refresh the ball game interface of the host APP of themobile phone 10.

The side of the mobile phone 10 includes a host APP and a Session.stubserver. After the communication connection is established between thesmart TV 20 and the mobile phone 10, the mobile phone 10 receives theremote view logic information (an interface control of the ball game)transferred by the smart TV 20, locally loads an interface of the ballgame, and displays the interface on the host APP. In addition, themobile phone 10 binds a service of the game APP in the smart TV 20, andafter binding the service, registers with an ISession mRemote handle inthe game APP by using a service interface externally disclosed by theservice. In this way, the smart TV 20 may update the ball game interfaceon the side of the mobile phone 10 by using the ISession mRemote handlein the game APP.

A local window on the side of the mobile phone 10 also displays a sameball game interface as that of the smart TV 20.

As shown in FIG. 5C, a procedure of controlling the ball game by usingthe mobile phone 10 and the smart TV 20 is specifically as follows:

Step S60: The smart TV 20 enters the host APP to start the ball game,selects a distributed game mode for the ball game, triggers coordinatedcontrol, and broadcasts a device connection request in a communicationnetwork in which the smart TV 20 is located.

According to some embodiments of this application, a manner in which thesmart TV 20 broadcasts the device connection request includes but is notlimited to: broadcasting the device connection request by using aNetWorkManager network management module of distributed middleware.

According to some embodiments of this application, after starting theball game, the smart TV 20 registers with a session mLocal handle in aGameApp module to refresh the ball game interface of the host APP of thesmart TV 20.

Step S61: The mobile phone 10 detects the device connection request.After detecting the device connection request, the mobile phone 10displays, on a display of the mobile phone 10, information related to adevice connection, so that the user performs an operation to connect tothe smart TV 20.

Step S62: The user operates the mobile phone 10 to trigger to connectthe mobile phone 10 and the smart TV 20. Specifically, the mobile phone10 receives the device connection request by using distributedmiddleware of the mobile phone 10, establishes a communicationconnection (which may be a socket connection) to the smart TV 20 basedon the device connection request, binds a service that is in the smartTV 20 and that is related to the ball game, and registers with a servicehandle.

Step S63: After the mobile phone 10 and the smart TV 20 are connected,the smart TV 20 sends remote view logic information (a game interface ofthe ball game on the side of the smart TV 20) to the mobile phone 10.

Step S64: A HostApp module of the mobile phone 10 receives the remoteview logic information, and locally loads an interface of the ball game.In addition, the HostApp module of the mobile phone 10 binds a servicecomponent in the GameApp module of the smart TV 20.

Step S65: The mobile phone 10 registers an ISession mRemote handle withthe GameApp module of the smart TV 20.

Step S66: The GameApp module of the smart TV 20 separately defines theslider control 52, the slider control 53, and the ball control 51. Theslider control 52 and the ball control 51 correspond to a HostApp moduleof the smart TV 20, and the slider control 53 and the ball control 51correspond to the HostApp module of the mobile phone 10.

Step S67: The smart TV 20 and the mobile phone 10 score. When the smartTV 20 operates the slider control 52, the ball control 51 is triggeredto collide with the grid block container control 500, and the GameAppmodule scores for the smart TV 20, and displays a score on a scoringcontrol 503 on a game interface of the smart TV 20. When the mobilephone 10 operates the slider control 53, the ball control 51 istriggered to collide with the grid block container control 501, and theGameApp module scores for the mobile phone 10, and displays a score on ascoring control 503 on a game interface of the mobile phone 10.

According to some embodiments of this application, there is a reset exitbutton 502 on both the game interfaces of the smart TV 20 and the mobilephone 10. When the user touches the reset exit button 502, both thesmart TV 20 and the mobile phone 10 may exit a current game interface inresponse to an operation of the user.

Step S68: A user of a device with a higher score within predeterminedtime wins.

In the technical solution in scenario 2, the mobile phone constructs alocal interface of the mobile phone based on the remote view logicinformation shared by the smut TV. The mobile phone only needs to loadthe remote view logic information to locally load the interface.Therefore, for the mobile phone end, there is no need to customize, fora game application of the smart TV, a component, a parameter, and thelike that are related to the game application, and only the remote viewlogic information transmitted by the smart TV needs to be loaded.Distributed application logic can be defined for all runningapplications of the smart TV on the side of the smart TV, and then thesmart TV synchronizes the distributed application logic with the mobilephone. In this way, application scenarios are numerous.

In some embodiments of this application, an electronic device is furtherprovided. The electronic device in this embodiment of this applicationis described below with reference to FIG. 6 . FIG. 6 is a schematicdiagram of a structure of an electronic device according to anembodiment of this application.

For at least one embodiment, a controller hub 804 communicates with aprocessor 801 by using a multi-branch bus such as a front side bus(FSB), a point-to-point interface such as quick path interconnect (QPI),or a similar connection. The processor 801 executes an instruction forcontrolling a data processing operation of a general type. In anembodiment, the controller hub 804 includes but is not limited to agraphics memory controller hub (GMCH) (not shown in the figure) and aninput/output hub (IOH) (which may be located on separate chips) (notshown in the figure). The GMCH includes a memory and a graphicscontroller and is coupled to the IOH.

An electronic device 800 may further include a coprocessor 806 and amemory 802 that are coupled to the controller hub 804. Alternatively,one or both of the memory 802 and the GMCH may be integrated into theprocessor 801 (as described in this application), the memory 802 and thecoprocessor 806 are directly coupled to the processor 801 and thecontroller hub 804, and the controller hub 804 and the IOH are in asingle chip.

In an embodiment, the memory 802 may be, for example, a dynamic randomaccess memory (DRAM), a phase change memory (PCM), or a combinationthereof. The memory 802 may include one or more tangible andnon-temporary computer-readable media for storing data and/orinstructions. The computer-readable storage medium stores instructions.Specifically, temporary and permanent copies of the instruction arestored.

In an embodiment, the coprocessor 806 is a dedicated processor, such asa high-throughput MIC processor, a network or communication processor, acompression engine, a graphics processor, a GPU, or an embeddedprocessor. An optional property of the coprocessor 806 is represented bya dashed line in FIG. 6 .

In an embodiment, the electronic device 800 may further include anetwork interface (MC) 803. The network interface 803 may include atransceiver configured to provide a radio interface for the device 800to communicate with any other suitable device (such as a front-endmodule or an antenna). In various embodiments, the network interface 803may be integrated with another component of the electronic device 800.The network interface 803 may implement a function of a communicationunit in the foregoing embodiment.

In an embodiment, as shown in FIG. 6 , the electronic device 800 mayfurther include an input/output (I/O) device 805. The input/output (I/O)device 805 may include a user interface, and this design enables a userto interact with the electronic device 800; a design of a peripheralcomponent interface enables the peripheral component to interact withthe electronic device 800; and/or a design of a sensor is used todetermine an environmental condition and/or position information relatedto the electronic device 800.

It should be noted that FIG. 6 is merely an example. In other words,although FIG. 6 shows that the electronic device 800 includes aplurality of components such as the processor 801, the controller hub804, and the memory 802, in actual application, a device that uses themethod in this application may include only some of the components ofthe electronic device 800, for example, may include only the processor801 and the NIC 803. A property of an optional component is shown by adashed line in FIG. 6 .

In some embodiments of this application, the instructions stored on thecomputer-readable storage medium of the electronic device 800 mayinclude: an instruction that enables a device to implement thecoordinated control methods for electronic devices mentioned in scenario1 and scenario 2 when at least one unit in the processor executes theinstruction. When the instruction is nm on a computer, the computer isenabled to perform the coordinated control methods for electronicdevices mentioned in scenario 1 and scenario 2.

FIG. 7 is a schematic diagram of a structure of a SOC according to anembodiment of this application. FIG. 7 is a block diagram of a SoC(System on Chip) 1000 according to an embodiment of this application. InFIG. 7 , similar components have same reference numerals. In addition, adashed-line frame is an optional feature of a more advanced SoC. The SoCmay be used by the electronic device according to an embodiment of thisapplication, and may implement a corresponding function based oninstructions stored in the SoC.

In FIG. 7 , the SoC 1000 includes: an interconnection unit 1002 that iscoupled to a processor 1001, a system proxy unit 1006, a bus controllerunit 1005, an integrated memory controller unit 1003, a group of or oneor more coprocessors 1007 that may include integrated graphics logic, animage processor, an audio processor, and a video processor, a staticrandom access memory (SRAM) unit 1008, and a direct memory access (DMA)unit 1004. In an embodiment, the coprocessor 1007 includes a dedicatedprocessor, such as a network or communication processor, a compressionengine, a GPGPU, a high-throughput MIC processor, or an embeddedprocessor.

The static random access memory (SRAM) unit 1008 may include one or morecomputer-readable media used to store data and/or instructions. Thecomputer-readable storage medium may store instructions. Specifically,temporary and permanent copies of the instruction are stored.

When the SoC 1000 is applied to the electronic device in thisapplication, the instructions stored on the computer-readable storagemedium may include: an instruction that enables the electronic device toimplement the coordinated control methods for electronic devicesmentioned in scenario 1 and scenario 2 when at least one unit in theprocessor executes the instruction. When the instruction is run on acomputer, the computer is enabled to perform the coordinated controlmethods for electronic devices mentioned in scenario 1 and scenario 2.

In addition, an embodiment of this application further discloses acomputer-readable storage medium. A processing program is stored in thecomputer-readable storage medium, and when the processing program isexecuted by a processor, the coordinated control methods for electronicdevices mentioned in scenario 1 and scenario 2 are implemented.

The computer-readable storage medium may be a read-only memory, a randomaccess memory, a hard disk, an optical disc, or the like.

1. A coordinated control method for electronic devices, wherein theelectronic devices comprise a first electronic device used as acontrolling party and a second electronic device used as a controlledparty that are connected based on near field communication, thecoordinated control method comprising: running, by the second electronicdevice, an application and triggering coordinated control, and sendingremote view logic information associated with the application to thefirst electronic device, wherein the remote view logic informationcomprises an interface layout file; receiving, by the first electronicdevice, the remote view logic information, locally loading, based on theinterface layout file, an interface related to the application, andbinding a service that is on a side of the second electronic device andthat is related to the application; and sending, by the first electronicdevice, control information to the second electronic device based on aservice interface externally disclosed by the service, so that the firstelectronic device controls the second device to run the application. 2.The coordinated control method according to claim 1, wherein theinterface layout file comprises an application control related to theapplication.
 3. The coordinated control method according to claim 2,wherein the binding a service that is on the side of the secondelectronic device and that is related to the application comprises:loading, by the first electronic device, the interface layout file;constructing, by the first electronic device, a view tree by loading theinterface layout file; and binding, by the first electronic device, theservice related to the application in a process of constructing the viewtree.
 4. The coordinated control method according to claim 2, whereinthe first electronic device locally loads the interface based on theinterface layout file.
 5. The coordinated control method according toclaim 1, wherein the control information is transferred by the serviceinterface externally disclosed by the service that is on the side of thesecond electronic device and that is bound by the first electronicdevice and related to the application.
 6. The coordinated control methodaccording to claim 5, wherein the first electronic device registers withCallBack related to the second electronic device, the first electronicdevice transfers an ICallBack handle to the second electronic devicethrough the service interface, and the second electronic devicereversely controls the first electronic device by using the ICallBackhandle.
 7. The coordinated control method according to claim 1, whereinwhen running a specific application, the second electronic devicetriggers the coordinated control.
 8. The coordinated control methodaccording to claim 7, wherein when running the application andtriggering the coordinated control, the second electronic deviceestablishes a data physical channel between the second electronic deviceand the first electronic device based on distributed middleware totransmit the remote view logic information.
 9. The coordinated controlmethod according to claim 8, wherein the data physical channel comprisesa socket channel.
 10. The coordinated control method according to claim9, wherein before the data physical channel is established between thefirst electronic device and the second electronic device, the firstelectronic device performs device trusted authentication and keycredential exchange on the first electronic device and the secondelectronic device by using the distributed middleware.
 11. Thecoordinated control method according to claim 8, wherein the distributedmiddleware separately provides a platform interface for the secondelectronic device and the first electronic device, to transfer theremote view logic information through the platform interface.
 12. Thecoordinated control method according to claim 11, wherein the secondelectronic device transfers the remote view logic information to thefirst electronic device through the platform interface in a form of abinary digital stream.
 13. The coordinated control method according toclaim 12, wherein the platform interface implements a cross-processbased on a binder mechanism.
 14. The coordinated control methodaccording to claim 8, wherein the coordinated control method furthercomprises: unbinding, by the first electronic device based on thedistributed middleware, the service that is bound on the side of thesecond electronic device and that is related to the application.
 15. Thecoordinated control method according to claim 1, when running theapplication, the second electronic device refreshes an interface on theside of the second electronic device based on the control information.16. A coordinated control system for electronic devices comprising: afirst electronic device used as a controlled party; a second electronicdevice is used as a controlled party, wherein the first electronicdevice and the second electronic device are connected based on nearfield communication; the second electronic device runs an applicationand triggers coordinated control, and sends remote view logicinformation associated with the application to the first electronicdevice, wherein the remote view logic information comprises an interfacelayout file; the first electronic device receives the remote view logicinformation, locally loads an interface based on the layout file, andbinds a service that is on a side of the second electronic device andthat is related to the application; and the first electronic devicesends control information to the second electronic device based on aservice interface externally disclosed by the service, so that the firstelectronic device locally controls the second device to run thebusiness.
 17. The coordinated control system according to claim 16,wherein when running the application, the second electronic devicerefreshes an interface on a side of the first electronic device based onthe control information.